/* CK 提取工具样式 */

.ck-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.ck-header {
    text-align: center;
    margin-bottom: 40px;
}

.ck-header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.ck-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 输入区域 */
.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.format-hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

.input-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    line-height: 1.6;
}

/* 配置区域 */
.config-section {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.config-item {
    flex: 1;
    min-width: 150px;
}

.config-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.config-item input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.config-item input:focus {
    outline: none;
    border-color: #3498db;
}

/* 字段输入组 */
.field-input-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.field-input-group input {
    flex: 1;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.dropdown-btn:hover {
    background: var(--bg-tertiary);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color-light);
    transition: background 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* 结果区域 */
.result-section {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-content {
    min-height: 100px;
    padding: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.result-content:empty::before {
    content: '提取结果将显示在这里...';
    color: var(--text-secondary);
    font-style: italic;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body .input-group {
    margin-bottom: 15px;
}

.modal-body .input-group:last-child {
    margin-bottom: 0;
}

.modal-body .input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.modal-body .input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-info {
    background: #007bff;
}

.toast-warning {
    background: #ffc107;
    color: #212529;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ck-container {
        padding: 15px;
    }

    .config-row {
        flex-direction: column;
    }

    .config-item {
        min-width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-actions {
        width: 100%;
    }

    .result-actions button {
        flex: 1;
    }
}

/* 滚动条样式 */
.result-content::-webkit-scrollbar,
.dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track,
.dropdown-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb,
.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb:hover,
.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
